Create Ocean Instance

Now that we are successfully connected with Web3, we can set up our Ocean instance.

At the beginning of your component, create a new Ocean instance with all required endpoint configurations within the componentDidMount lifecycle method. All Ocean Protocol operations can be executed from this Ocean instance.

Run Spree with Barge

Note that compiling and deploying the contracts in your local Docker network takes some time so it can take a few minutes until the network is ready to be interacted with. That usually is the case once keeper-contracts_1 container doesn’t show any messages anymore.

Copy Contract Artifacts

At the end of the contract compiling and deploying you need to copy the resulting Spree contract artifacts from the Docker container to your local @oceanprotocol/keeper-contracts dependency folder. The keeper-contracts Docker container will output all artifacts in a hidden folder in your home folder so you can copy from there: