Publishing to Eph

letting you get up and running in minutes.

Finding the ‘Content Hub’

Log in to Euphoria to find the ‘Publish’ tab for defining Smart Contracts, setting up contributors/tracks and more.

As a Publisher, your Euphoria experience is different than Licensees’ and consumers’. We did this to keep things simple. If you want to enjoy the music on Eph as a consumer, sign up for another account.

Scenario

You’re going to use Smart Contracts to demonstrate a fun scenario with the Bach Street Boys (get it?). In this scenario, you’re working on behalf of the Bach Street Boys, but you could easily be them — we’ve made publishing Eph to trivial.

You’ll see there’s already a default contributor belonging to you called ‘[New User] Bach Street Boys’. Feel free to ignore this — it’s to let you get started as quickly as possible.

Creating a contributor

To stop new Publishers from flooding Eph with default contributors and tracks, Eph ignores contributors and tracks that have names beginning with ‘[New User]’. The warning inside Euphoria will go away if you change the name:

Hit save and you’ll see the contributor has been updated in the list. Look carefully below the name; see ‘ID <...>’? We’ll talk about that next...

Contributors and IDs

Identifying a unique contributor in a Smart Contract by name is difficult — just think of all the ABBA tribute bands out there! Eph gives each contributor a unique (incrementing) ID number. You can be sure that:

  • A contributor will always have the same ID, even if its name is changed
  • A contributor that gets deleted will not ‘give up’ its ID; consider the ID used and unavailable when deleting a contributor (if you have contributor IDs 1/2/3 and delete 2, the next created contributor will have ID 4, not ID 2)

Editing a track

Edit the default track with the ‘three dots’. You’re going to see 2 options for editing a track:

  • ‘Edit Metadata’: edit the name, album and artists of the song. (the artists defined here are completely unrelated to the Smart Contract/contributors — this field is just text; they are displayed to consumers and can be used to find tracks but have no other function)
  • ‘Edit Smart Contract’: edit the logic for paying contributors when the track is played

Choose ‘Edit Smart Contract’.

Under ‘My Contributors’ you can see Bach Street Boys. This list is ordered by ID, so the most recently created contributors are at the top. Remember the ID number of Bach Street Boys! It is 9 for us, but it will be a different number for you.

The Smart Contract code lives in the white text editor at the top. Every time you change the smart contract, Euphoria makes you test it (nobody will get paid when testing). You have to test the code to save it.

Swap out the code for the following. Be sure to replace <ID_NUMBER> with the ID number of Bach Street Boys:

return {"<ID_NUMBER>": 100};

In our case the code looks like this:

return {"9": 100};

Hit ‘Test’. ‘Test Result: Success’ tells us the code worked. Below that you can see that Bach Street Boys get 100 percent of the royalty for each track play:

Hit ‘Save’.

Read the Integration Guide Smart Contract Code Reference to learn more about writing Smart Contract code — it’s just JavaScript.