Opporty Plasma Cash contains a set of smart contracts and microservices performing Node functions. You can run it on different servers. Each microservice has an API with documentation. There is also a CLI. Plasma Cash allows you to conduct public and private transactions using the zk-snark tool. You can confidentially transfer standard ERC-20 and ERC-721 tokens within the Ethereum blockchain.
Please note that this technology is still in a test mode and needs more profound elaboration to be released as a ready-made product. We continue working on Plasma Cash and searching for advanced solutions that can make our innovative project even better. We have shared news about Plasma Cash with the purpose of stimulating the adoption of public blockchains. We want to show to the community that progressive projects are being developed in this industry and it deserves close attention. Also, we use the comments of those who have checked out our solution as guidelines for further work. Your feedback, both positive and negative, is very important for us. If the current version of Plasma Cash simplifies your work, this proves our efforts were not made in vain. If you find some drawbacks, be sure to inform us about them. Thus you will help our project evolve and grow.
We do not recommend using the prototype for the processing of classified data and the transfer of funds since it has not yet passed a security check. We do not undertake responsibility for damage caused by the failures of this version, so you should better test it on minor tasks.
The guidelines below should give you a clear idea of how to conduct the Nightfall setup and start using Plasma Cash. Since significant computing resources are needed, you should better opt for a high-end processor. The setup would last from one to a couple of hours, depending on your equipment.
Mac and Linux machines with at least 64GB of memory and 512GB of disk space are supported.
The Opporty Plasma Cash demonstration requires the following software to run:
- Docker
- Launch Docker Desktop (on Mac, it is on the menu bar) and set memory to 8GB with 4GB of swap space (minimum - 12GB memory is better) or 16GB of memory with 512MB of swap. The default values for Docker Desktop will NOT work. No, they really won't.
- https://docs.docker.com/install/linux/docker-ce/debian/
Docker compose https://docs.docker.com/compose/install/
Clone the Plasma Cash repository and use a terminal to enter the directory.
-
git clone https://github.com/opporty-com/Plasma-Cash.git plasma
-
cd plasma
Set up a test Ether Node.
-
cd plasma/bin/ethernode/
-
./up-dev.sh -d
Set up a smart contract.
./migration-dev.sh
Launch Plasma.
- Change contract address into
plasma/docker-compose-dev.yml
which has been received on previous step and ip address your server file
Root: 0xe40d2fee1554cd536c630bf5af30fdfe97f924de
-
cd
plasma/bin` -
./up-dev.sh -d
Run demo.
-
cd plasma
-
docker-compose -f docker-compose-dev.yml exec mainnode npm run demo
There are test cases for plasma api controllers
Go to bin/
directory
http://localhost:55555/documentation
Run test-api-block
for start blocks test.
This test case include ( you can change params in BLOCK_NUMBERS_ARRAY
constant ):
- getBlock test ( by block number )
- Should get block number
BLOCK_NUMBERS_ARRAY[number]
- Should get block number
- getLastBlock test
- Should get last block
./run-some-test.sh "npm run test-api-block"
Run test-api-transaction
for try create transaction test.
This test case include ( you can change params in TRX_ARRAY
and TRX_HASH
constants ):
- createTransaction
- Should create Transaction where prevBlock is
TRX_ARRAY[prevBlock]
- Should create Transaction where prevBlock is
- getPool
- Should get Pool
- getTransactions ( by hash )
- Should get transaction where hash is
TRX_HASH[index]
- Should get transaction where hash is
./run-some-test.sh "npm run test-api-transaction"
Run test-api-token
for get tokens.
This test case include ( you can change params in TOKEN_IDS
and TOKEN_ADDRESSES
constants ):
- getToken ( by address )
- Should get token by address -
TOKEN_ADDRESSES[index]
- Should get token by address -
- getToken ( by token id )
- Should get token by token id -
TOKEN_IDS[index]
- Should get token by token id -
- getLastTransaction ( by token )
- Should get last transaction by token -
TOKEN_IDS[index]
- Should get last transaction by token -
- getAllTransactions ( by token )
- Should get last transaction by token -
TOKEN_IDS[index]
- Should get last transaction by token -
./run-some-test.sh "npm run test-api-token"
Run test-api-validator
for start validators tests.
This test case include:
- Validators
- getCandidates
- getValidators
- getCurrent
./run-some-test.sh "npm run test-api-validator"
Run test-api-deposit
for create deposit ( you can change deposit data in DATA_FOR_DEPOSIT
constant ).
./run-some-test.sh "npm run test-api-deposit"
Run test-api-run
for start all tests.
This command will run all tests above.
./run-tests.sh