README.md
babel.config.js
contract
    Cargo.toml
    README.md
    compile.js
    src
        lib.rs
    target
        .rustc_info.json
        debug
            .fingerprint
                Inflector-421fec9da2450b13
                    lib-inflector.json
                autocfg-10f050a60f0851d4
                    lib-autocfg.json
                borsh-derive-2c9bae8573031336
                    lib-borsh-derive.json
                borsh-derive-internal-1bd62c8c7c1e7b81
                    lib-borsh-derive-internal.json
                borsh-schema-derive-internal-28b251e824bdb6f1
                    lib-borsh-schema-derive-internal.json
                byteorder-2fee559003480541
                    build-script-build-script-build.json
                convert_case-fd3f3eda7d128328
                    lib-convert_case.json
                derive_more-48d6873a850c1327
                    lib-derive_more.json
                generic-array-2779262564493281
                    build-script-build-script-build.json
                hashbrown-20b80f628e4bd520
                    lib-hashbrown.json
                hashbrown-2ebe92614a34df13
                    run-build-script-build-script-build.json
                hashbrown-da37d4392ec6455b
                    build-script-build-script-build.json
                indexmap-608f0cdbf4a2f0c2
                    run-build-script-build-script-build.json
                indexmap-85a831240cca7b1e
                    build-script-build-script-build.json
                indexmap-a1928c98df72f240
                    lib-indexmap.json
                itoa-0c4afa5ddf3b01b6
                    lib-itoa.json
                memchr-6e67e2699653af0a
                    build-script-build-script-build.json
                near-rpc-error-core-e321ce3900c316a1
                    lib-near-rpc-error-core.json
                near-rpc-error-macro-08f88f4b8af1d95a
                    lib-near-rpc-error-macro.json
                near-sdk-core-69000b972137e98d
                    lib-near-sdk-core.json
                near-sdk-macros-3095662dc8cddf72
                    lib-near-sdk-macros.json
                num-bigint-428aa12d461281d5
                    build-script-build-script-build.json
                num-integer-c2fd55dd6ca94d3f
                    build-script-build-script-build.json
                num-rational-821f0488a696a932
                    build-script-build-script-build.json
                num-traits-6b8559fb0f812e5b
                    build-script-build-script-build.json
                proc-macro-crate-51faf7a6969293f2
                    lib-proc-macro-crate.json
                proc-macro2-6e989d10b7180836
                    run-build-script-build-script-build.json
                proc-macro2-c6b528058b5f4112
                    build-script-build-script-build.json
                proc-macro2-e10d1cfce506c4e3
                    lib-proc-macro2.json
                quote-8824194b103d456f
                    lib-quote.json
                ryu-434de6aa728fcc03
                    build-script-build-script-build.json
                ryu-48e88b40ca9eb950
                    run-build-script-build-script-build.json
                ryu-f933a429278f7624
                    lib-ryu.json
                serde-14553aa89352af97
                    run-build-script-build-script-build.json
                serde-3e32a2ee4bbf5b18
                    lib-serde.json
                serde-42ea2b9ba199bc16
                    build-script-build-script-build.json
                serde_derive-3b3203750f84de75
                    run-build-script-build-script-build.json
                serde_derive-87755857f00aee87
                    lib-serde_derive.json
                serde_derive-c290a943d95858e2
                    build-script-build-script-build.json
                serde_json-99151f6afe727bb0
                    build-script-build-script-build.json
                serde_json-cd102e09047f5f79
                    run-build-script-build-script-build.json
                serde_json-e9d7ae203685f39f
                    lib-serde_json.json
                syn-296bb421c99d9f34
                    run-build-script-build-script-build.json
                syn-48bfcd71b3413f31
                    build-script-build-script-build.json
                syn-688e66ae8cc99712
                    lib-syn.json
                toml-6ce6bce51eba75db
                    lib-toml.json
                typenum-c0b6e4bed433a45d
                    build-script-build-script-main.json
                unicode-xid-a6b77c0954f215e8
                    lib-unicode-xid.json
                version_check-2914e3c918269eb0
                    lib-version_check.json
                wee_alloc-2bf4422d6e538e1a
                    build-script-build-script-build.json
        release
            .fingerprint
                Inflector-c81332a08dcc44c8
                    lib-inflector.json
                autocfg-cbe978e5cfd84664
                    lib-autocfg.json
                borsh-derive-554be1d5b2670387
                    lib-borsh-derive.json
                borsh-derive-internal-6b33443b2c581ab9
                    lib-borsh-derive-internal.json
                borsh-schema-derive-internal-29684ba7c3ee9082
                    lib-borsh-schema-derive-internal.json
                byteorder-b6e3c03662bdfd2e
                    build-script-build-script-build.json
                convert_case-01c35c1e0cb8910d
                    lib-convert_case.json
                derive_more-b8bd27dd3bcff4c1
                    lib-derive_more.json
                generic-array-1cb10a41891b6297
                    build-script-build-script-build.json
                hashbrown-226baa89d7d44b24
                    run-build-script-build-script-build.json
                hashbrown-72b4323ab687651a
                    lib-hashbrown.json
                hashbrown-ffe2a56341b50bb2
                    build-script-build-script-build.json
                indexmap-268af32321ecda9a
                    build-script-build-script-build.json
                indexmap-2b6f71cbad9dfd97
                    lib-indexmap.json
                indexmap-32a5de69cc54843b
                    run-build-script-build-script-build.json
                itoa-b25325070690a949
                    lib-itoa.json
                memchr-0cb529d02c8b34df
                    build-script-build-script-build.json
                near-rpc-error-core-51dc2c61a4369db8
                    lib-near-rpc-error-core.json
                near-rpc-error-macro-3dcce272c30d6221
                    lib-near-rpc-error-macro.json
                near-sdk-core-12a040dc65da0366
                    lib-near-sdk-core.json
                near-sdk-macros-e37667338318a74a
                    lib-near-sdk-macros.json
                num-bigint-e55effcee0a12900
                    build-script-build-script-build.json
                num-integer-c671aa466a9c10f4
                    build-script-build-script-build.json
                num-rational-1916bddca05e4813
                    build-script-build-script-build.json
                num-traits-33749dff01280a48
                    build-script-build-script-build.json
                proc-macro-crate-2e3f536f55ac3aff
                    lib-proc-macro-crate.json
                proc-macro2-228aae955d2b1bd8
                    run-build-script-build-script-build.json
                proc-macro2-6dff4515e3bf7c7b
                    build-script-build-script-build.json
                proc-macro2-7242a0b8a6a5eaf3
                    lib-proc-macro2.json
                quote-2aafed374ad175ad
                    lib-quote.json
                ryu-024fdbef02b172d8
                    run-build-script-build-script-build.json
                ryu-223123f024744262
                    lib-ryu.json
                ryu-4a1aee0abb7cd438
                    build-script-build-script-build.json
                serde-3a45f0f96b0fa0f8
                    lib-serde.json
                serde-544300c7de72b764
                    run-build-script-build-script-build.json
                serde-8f0ca11607d7ff74
                    build-script-build-script-build.json
                serde_derive-79fb3c10bf8bcdc5
                    build-script-build-script-build.json
                serde_derive-b742afd59bc1e172
                    run-build-script-build-script-build.json
                serde_derive-e1aee10de2e49366
                    lib-serde_derive.json
                serde_json-0f5f4c9d3f4f3378
                    build-script-build-script-build.json
                serde_json-1f542780fcbb5926
                    lib-serde_json.json
                serde_json-62292b2e21377648
                    run-build-script-build-script-build.json
                syn-3a9ea73888f4fd6d
                    build-script-build-script-build.json
                syn-49769c3183395c15
                    run-build-script-build-script-build.json
                syn-dc99a9bb9281bb8c
                    lib-syn.json
                toml-219bfb55c915d81d
                    lib-toml.json
                typenum-3220042491a311dc
                    build-script-build-script-main.json
                unicode-xid-d2e458abd9496d33
                    lib-unicode-xid.json
                version_check-464709a2e9ffc722
                    lib-version_check.json
                wee_alloc-31bf8cf899c7a0d9
                    build-script-build-script-build.json
        wasm32-unknown-unknown
            debug
                .fingerprint
                    ahash-fa2210e97843f4ad
                        lib-ahash.json
                    aho-corasick-e2cfe3876d2b84a5
                        lib-aho_corasick.json
                    base64-254d02c6dbc97ed3
                        lib-base64.json
                    block-buffer-59aff2a7c02a1af8
                        lib-block-buffer.json
                    block-buffer-6edd453b3a1e92ea
                        lib-block-buffer.json
                    block-padding-87c5d9cd96df8533
                        lib-block-padding.json
                    borsh-5c92855b0956eabb
                        lib-borsh.json
                    bs58-23a386e28e880a89
                        lib-bs58.json
                    byte-tools-5268c94bb2c5b087
                        lib-byte-tools.json
                    byteorder-95b689927f60073d
                        run-build-script-build-script-build.json
                    byteorder-bf9b3aa34efc69c7
                        lib-byteorder.json
                    cfg-if-1cd5b12b2c7578f3
                        lib-cfg-if.json
                    cfg-if-e930fb202b63612a
                        lib-cfg-if.json
                    digest-27094599b98e3eda
                        lib-digest.json
                    digest-970e9f03114856ad
                        lib-digest.json
                    generic-array-2d59ad8d42dc365a
                        lib-generic_array.json
                    generic-array-495f8487c630bc76
                        run-build-script-build-script-build.json
                    generic-array-68c81b3be9373d29
                        lib-generic_array.json
                    greeter-98ace302c5fafa12
                        lib-greeter.json
                    hashbrown-8c96461529b90c64
                        lib-hashbrown.json
                    hashbrown-af97098fabe7e2ca
                        lib-hashbrown.json
                    hashbrown-b14ea15f0c0b571d
                        run-build-script-build-script-build.json
                    hex-361568f410c04db4
                        lib-hex.json
                    indexmap-64ede45148d7aaec
                        run-build-script-build-script-build.json
                    indexmap-dd32e2efc564b802
                        lib-indexmap.json
                    itoa-9df98163022f3db2
                        lib-itoa.json
                    keccak-10f3fe4d4661ea51
                        lib-keccak.json
                    lazy_static-7ba39ce008ae1372
                        lib-lazy_static.json
                    memchr-20fff08d42b23e68
                        lib-memchr.json
                    memchr-83393503b9d8e72c
                        run-build-script-build-script-build.json
                    memory_units-7758907f042da43e
                        lib-memory_units.json
                    near-primitives-core-787d77ecb8c20538
                        lib-near-primitives-core.json
                    near-runtime-utils-e2142c28a4b722ae
                        lib-near-runtime-utils.json
                    near-sdk-d5ff1a9d4b70d2d5
                        lib-near-sdk.json
                    near-vm-errors-580d912f4b6e7827
                        lib-near-vm-errors.json
                    near-vm-logic-f88860cf47e7a7b1
                        lib-near-vm-logic.json
                    num-bigint-836d97744bbf06e2
                        run-build-script-build-script-build.json
                    num-bigint-e7963ed3db7ed147
                        lib-num-bigint.json
                    num-integer-42fbc122e49f8da8
                        run-build-script-build-script-build.json
                    num-integer-a2926d0e455a171d
                        lib-num-integer.json
                    num-rational-344b1ecd750faeff
                        run-build-script-build-script-build.json
                    num-rational-3abefbe3af24c03a
                        lib-num-rational.json
                    num-traits-161c05c92fd2f027
                        lib-num-traits.json
                    num-traits-678857698c836f20
                        run-build-script-build-script-build.json
                    opaque-debug-7df52cb9aab9a7c7
                        lib-opaque-debug.json
                    opaque-debug-b0777fe7745352ee
                        lib-opaque-debug.json
                    regex-580d16f0249bb7e7
                        lib-regex.json
                    regex-syntax-a4fa08328ed07945
                        lib-regex-syntax.json
                    ryu-23905b90ecf58c0d
                        run-build-script-build-script-build.json
                    ryu-5ac909b8b9f903b5
                        lib-ryu.json
                    serde-3bc3b2e3a91367d5
                        run-build-script-build-script-build.json
                    serde-af477425fa64ff15
                        lib-serde.json
                    serde_json-422fd7b1dabbc896
                        lib-serde_json.json
                    serde_json-d781bc3f541cdacc
                        run-build-script-build-script-build.json
                    sha2-8b7e9ad97c21c747
                        lib-sha2.json
                    sha3-b6c649e7ca647d88
                        lib-sha3.json
                    typenum-25ff754cfe73c661
                        lib-typenum.json
                    typenum-e5a0178000d0f867
                        run-build-script-build-script-main.json
                    wee_alloc-b6544f05f7ef506d
                        lib-wee_alloc.json
                    wee_alloc-e258b329bcce949c
                        run-build-script-build-script-build.json
            release
                .fingerprint
                    ahash-f4864683d022ced4
                        lib-ahash.json
                    aho-corasick-dc37d13395fc3f26
                        lib-aho_corasick.json
                    base64-ef0a6ac21d1f9d9c
                        lib-base64.json
                    block-buffer-238ff418713d4837
                        lib-block-buffer.json
                    block-buffer-c788ede8d02b0692
                        lib-block-buffer.json
                    block-padding-6d9595baf67deba4
                        lib-block-padding.json
                    borsh-346a863dd5605f71
                        lib-borsh.json
                    bs58-eff968f52b7383dc
                        lib-bs58.json
                    byte-tools-a10b30fcf0ffb4c3
                        lib-byte-tools.json
                    byteorder-4e92aea1612a7b6f
                        lib-byteorder.json
                    byteorder-6db1d52509ea66ba
                        run-build-script-build-script-build.json
                    cfg-if-b0524622f57d6f50
                        lib-cfg-if.json
                    cfg-if-c79cf4fe8714a571
                        lib-cfg-if.json
                    digest-02a6af6ea0af16d2
                        lib-digest.json
                    digest-40faa31b7a9f53df
                        lib-digest.json
                    generic-array-82b8d6e239541d60
                        run-build-script-build-script-build.json
                    generic-array-901dbfbbdce76351
                        lib-generic_array.json
                    generic-array-ef106c548100a65d
                        lib-generic_array.json
                    greeter-98ace302c5fafa12
                        lib-greeter.json
                    hashbrown-07b447bbdc4eb7eb
                        lib-hashbrown.json
                    hashbrown-0b66f04e39209ac4
                        run-build-script-build-script-build.json
                    hashbrown-2e09e322fb6e7f49
                        lib-hashbrown.json
                    hex-be10d398145bd052
                        lib-hex.json
                    indexmap-996713417835b918
                        lib-indexmap.json
                    indexmap-cfcc78f86546622b
                        run-build-script-build-script-build.json
                    itoa-6d2de69c50d70c92
                        lib-itoa.json
                    keccak-aff4d5a2a9b7047d
                        lib-keccak.json
                    lazy_static-73ac36aad24e1f10
                        lib-lazy_static.json
                    memchr-134aba35d5d614a9
                        lib-memchr.json
                    memchr-6fa328b74bb38ae6
                        run-build-script-build-script-build.json
                    memory_units-1a891aa070e9521e
                        lib-memory_units.json
                    near-primitives-core-958be281bd6138d5
                        lib-near-primitives-core.json
                    near-runtime-utils-9ca337f99cf1320c
                        lib-near-runtime-utils.json
                    near-sdk-dee15349391a8e16
                        lib-near-sdk.json
                    near-vm-errors-7534071cc9c149bb
                        lib-near-vm-errors.json
                    near-vm-logic-4fccb39c309c4890
                        lib-near-vm-logic.json
                    num-bigint-b84739cd9fc26ac1
                        run-build-script-build-script-build.json
                    num-bigint-f2427ee1d378cada
                        lib-num-bigint.json
                    num-integer-3bbabda148e263ef
                        lib-num-integer.json
                    num-integer-6569c746227eda94
                        run-build-script-build-script-build.json
                    num-rational-3e6273fe9b6004c6
                        run-build-script-build-script-build.json
                    num-rational-a08ecf4835be8069
                        lib-num-rational.json
                    num-traits-ca0cb938f16e1e73
                        run-build-script-build-script-build.json
                    num-traits-ecd613f66de50323
                        lib-num-traits.json
                    opaque-debug-2c8878b78b68d493
                        lib-opaque-debug.json
                    opaque-debug-3bcaaf8e3f160fb1
                        lib-opaque-debug.json
                    regex-b4cf082f5edeb2aa
                        lib-regex.json
                    regex-syntax-07220c22c1f02d8a
                        lib-regex-syntax.json
                    ryu-8a3e62140d381ea2
                        lib-ryu.json
                    ryu-8d8bf12eac83701d
                        run-build-script-build-script-build.json
                    serde-41cc6821216b8407
                        run-build-script-build-script-build.json
                    serde-5d0e7f4d5951e64e
                        lib-serde.json
                    serde_json-53a6c19edee28f01
                        lib-serde_json.json
                    serde_json-54618afffa67d4f9
                        run-build-script-build-script-build.json
                    sha2-e1c10fd8baaf2247
                        lib-sha2.json
                    sha3-fde6d0a3e8c8b53f
                        lib-sha3.json
                    typenum-7f38a42e24e4a886
                        run-build-script-build-script-main.json
                    typenum-d318d31fc3fdba6f
                        lib-typenum.json
                    wee_alloc-40cf271d7cb4f580
                        lib-wee_alloc.json
                    wee_alloc-7c8cd686a1b31e25
                        run-build-script-build-script-build.json
package.json
src
    App.js
    __mocks__
        fileMock.js
    assets
        logo-black.svg
        logo-white.svg
    config.js
    global.css
    index.html
    index.js
    jest.init.js
    main.test.js
    utils.js
    wallet
        login
            index.html

SharingShard ---
==================
Share a knowledge capsule with friends asking to enhance the information and engage in a conversation

Quick Start
===========

To run this project locally:

1. Prerequisites: Make sure you've installed [Node.js] ≥ 12
2. Install dependencies: `yarn install`
3. Run the local development server: `yarn dev` (see `package.json` for a
   full list of `scripts` you can run with `yarn`)

Now you'll have a local development environment backed by the NEAR TestNet!

Go ahead and play with the app and the code. As you make code changes, the app will automatically reload.

Exploring The Code
==================

1. The "backend" code lives in the `/contract` folder. See the README there for
   more info.
2. The frontend code lives in the `/src` folder. `/src/index.html` is a great
   place to start exploring. Note that it loads in `/src/index.js`, where you
   can learn how the frontend connects to the NEAR blockchain.
3. Tests: there are different kinds of tests for the frontend and the smart
   contract. See `contract/README` for info about how it's tested. The frontend
   code gets tested with [jest]. You can run both of these at once with `yarn
   run test`.

Deploy
======

Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `yarn dev`, your smart contract gets deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how.

Step 0: Install near-cli (optional)
-------------------------------------

[near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `yarn install`, but for best ergonomics you may want to install it globally:

    yarn install --global near-cli

Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx`

Ensure that it's installed with `near --version` (or `npx near --version`)

Step 1: Create an account for the contract
------------------------------------------

Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `sharingshard.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `sharingshard.your-name.testnet`:

1. Authorize NEAR CLI, following the commands it gives you:

      near login

2. Create a subaccount (replace `YOUR-NAME` below with your actual account name):

      near create-account sharingshard.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet

Step 2: set contract name in code
---------------------------------

Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above.

    const CONTRACT_NAME = process.env.CONTRACT_NAME || 'sharingshard.YOUR-NAME.testnet'

Step 3: deploy!
---------------

One command:

    yarn deploy

As you can see in `package.json`, this does two things:

1. builds & deploys smart contract to NEAR TestNet
2. builds & deploys frontend code to GitHub using [gh-pages]. This will only work if the project already has a repository set up on GitHub. Feel free to modify the `deploy` script in `package.json` to deploy elsewhere.

Troubleshooting
===============

On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details.

  [React]: https://reactjs.org/
  [create-near-app]: https://github.com/near/create-near-app
  [Node.js]: https://nodejs.org/en/download/package-manager/
  [jest]: https://jestjs.io/
  [NEAR accounts]: https://docs.near.org/docs/concepts/account
  [NEAR Wallet]: https://wallet.testnet.near.org/
  [near-cli]: https://github.com/near/near-cli
  [gh-pages]: https://github.com/tschaub/gh-pages

Contributors
============

- [Jorge Ortega - @Jorgewlf88](https://github.com/Jorgewlf88)
- [Jorge Zavala - @kinnevo](https://github.com/kinnevo)
- [Juan Carlos Iglesias - @jciglesias](https://github.com/jciglesias)
sharingshard Smart Contract
==================

A [smart contract] written in [Rust] for an app initialized with [create-near-app]

Quick Start
===========

Before you compile this code, you will need to install Rust with [correct target]

Exploring The Code
==================

1. The main smart contract code lives in `src/lib.rs`. You can compile it with
   the `./compile` script.
2. Tests: You can run smart contract tests with the `./test` script. This runs
   standard Rust tests using [cargo] with a `--nocapture` flag so that you
   can see any debug info you print to the console.

  [smart contract]: https://docs.near.org/docs/develop/contracts/overview
  [Rust]: https://www.rust-lang.org/
  [create-near-app]: https://github.com/near/create-near-app
  [correct target]: https://github.com/near/near-sdk-rs#pre-requisites
  [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html
